/**
 * @file 09.c
 * @author your name (you@domain.com)
 * @brief 从 1加到 n的和
 * @version 0.1
 * @date 2022-04-13
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#include <stdio.h>

int main()
{
    int i, n, sum = 0;
    printf("Upto how many terms you want to find the sum:");
    scanf("%d", &n);
    for (i = 1; i <= n; i++)
    {
        sum = sum + i;
    }
    printf("Sum is %d\n", sum);
    return 0;
}